<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>叩丁狼客户关系管理系统-登录</title>
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/js/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/js/Ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="/js/adminlte/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/js/adminlte/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="/js/adminlte/css/fonts.googleapis.com.css">

    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.js"></script>
    <script src="/js/adminlte/js/adminlte.min.js"></script>
    <script src="/js/plugins/twbsPagination/jquery.twbsPagination.min.js"></script>
    <script src="/js/plugins/messager/jquery.bootstrap.min.js"></script><!--引入插件-->
    <script src="js/plugins/jquery-form/jquery.form.js"></script><!--引入前端插件,jquery-form 表单异步提交插件-->
    <script>
        $(function () {
            $('.submitBtn').click(function () {
                /*/!* 表单序列化,把表单内的控件(input select textarea) 有name的
                 控件以及对应的值,使用key = value的形式拼接在一起*!/
                var param = $('#loginForm').serialize();
                //提交异步请求
                $.post('/login.do',param,function (data) {
                    if (data.success){
                        window.location.href = "/employee/list.do";
                    } else{
                        $.messager.popup(data.msg);
                    }
                })*/

                //ajaxSubmit把表单升级为ajax异步方式,并且马上提交,针对button
                $("#loginForm").ajaxSubmit(function (data) {
                    if (data.success) {
                        window.location.href = "/employee/list.do";
                    }else {
                        $.messager.popup(data.msg)
                    }
                })
            })
      })

    </script>
</head>
<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="http://www.wolfcode.cn"><b>叩丁狼</b>CRM</a>
    </div>
    <div class="login-box-body">
        <p class="login-box-msg">请输入账号密码</p>

        <form method="post" id="loginForm" action="/login.do">
            <div class="form-group has-feedback">
                <input type="text" class="form-control" placeholder="请输入账号" name="username" value="admin">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control" placeholder="请输入密码" name="password" value="1">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <div class="col-xs-4">
                    <!--默认type="smbit"改为button,不让它自动提交-->
                    <button type="button" class="btn btn-primary btn-block btn-flat submitBtn">登录</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>
